package com.zj.easy.ui.utils

import android.graphics.Color


/**
 * 解析为颜色值
 */
fun String?.parseColor(): Int {
    try {
        return if (isNullOrBlank()) 0 else Color.parseColor(if (startsWith("#")) this else "#$this")
    } catch (e: Exception) {
    }
    return 0
}